package com.qf.sl.youshare.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by IDEA
 * User : sl
 * on 2015/2/26.
 * 19:37
 */
public class DBHelper extends SQLiteOpenHelper {

    public static final int VERSION = 1;
    public static final String TABLE_PRODUCT_FAVORITES = "product_collect";

    public static final String CREATE_TABLE_PRODUCT_FAVORITES
            = "create table " + TABLE_PRODUCT_FAVORITES + " (" +
            "_id integer primary key autoincrement," +
            "pid text not null," +
            "name text not null," +
            "price float default 0.0," +
            "description text," +
            "thumb text," +
            "type text," +
            "user_id text)";

    public DBHelper(Context context) {
        super(context, "youShareDB", null, VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_TABLE_PRODUCT_FAVORITES);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
